<template>
  <el-form class="tl-form" ref="form" label-width="150px">
      <div class="tl-form-line-title" v-if="feedbackList.length >0">
        任务反馈
      </div>
    <el-timeline>
      <el-timeline-item v-for="(item, index) in feedbackList" :key="index" color="#0A6ED2" style="margin-top: 20px">
        任务反馈{{ index + 1 }}
            <el-row>
              <el-col :span="24">
                <el-form-item label="反馈细节">
                  <el-input v-model="item.taskfeedbackdetail" type="textarea" :rows="2" :disabled="true"/>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="12">
                <el-form-item label="任务进度">
                  <el-input v-model="item.taskschedule" class="unitInputNumber" :disabled="true"/><span class="unitSpan">%</span>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row v-if="item.isdelivery === '1'">
            <el-col :span="12">
              <el-form-item label="已完成数量">
                <el-input-number v-model="item.newamount" style="width:95%" :disabled="true" controls-position="right">
                </el-input-number><span class="unitSpan">只</span>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="已完成金额">
                <el-input-number v-model="item.newfund" style="width:95%" :disabled="true" controls-position="right">
                </el-input-number><span class="unitSpan">万元</span>
              </el-form-item>
            </el-col>
            </el-row>
      </el-timeline-item>
    </el-timeline>
  </el-form>
</template>

<script>
/** mixins */
import { mixin_edit } from '@tapui/mixins/mixin_edit'
/** 工具类 */
import { putAction, getAction, postAction, deleteAction } from "@tapui/utils/http"
/** VUE配置 */
export default {
  mixins: [mixin_edit],
  data() {
    return {
      urlPrefix: '/sd/projectTaskFeedback/',
      url: {
        list: '/sd/projectTaskFeedback/list'
      },
      feedbackList: []
    }
  },
  methods: {
    queryTaskFeedbackList(taskId) {
      this.feedbackList = []
      let param = {
        qry_taskid: taskId,
        sidx: 'submitdate',
        sord: 'desc',
        currentPage: 1,
        pageSize: 50,
        qry_state: '9'
      }
      getAction(this.url.list, param).then((res) => {
        if (res.success) {
          if (res.result.dataList.length > 0) {
            this.feedbackList = res.result.dataList
            this.$emit('resize')
          }
        } else {
          this.$tap.alert(res.message, 'warning')
        }
      }).catch((err) => {
        this.$tap.alert(err.message, 'warning')
      })
    }
  }
}
</script>
